﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Vra.DataAccess;
using VRA.BusinessLayer;
using VRA.Dto;
using VRA.BusinessLayer.Converters;

namespace VRA.BusinessLayer
{
   public class CustomerProcessDB : ICustomerProcess
    {
       private readonly ICustomerDao _customerDao;

   public CustomerProcessDB()
	{

        _customerDao = DaoFactory.GetCustomerDao();
	}

	public IList<CustomerDto> GetList()
	{
		return DtoConverter.Convert(_customerDao.GetAll());
	}

	public CustomerDto Get(int id)
	{
		return DtoConverter.Convert(_customerDao.Get(id));
	}

	public void Add(CustomerDto customer)
	{
		_customerDao.Add(DtoConverter.Convert(customer));
	}

	public void Update(CustomerDto customer)
	{
		_customerDao.Update(DtoConverter.Convert(customer));
	}

	public void Delete(int id)
	{
		_customerDao.Delete(id);
	}

    }
}
